package com.hengyue.asset.domain.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.hengyue.common.core.entity.BaseEntity;
import com.hengyue.common.core.entity.CoreBaseDataEntity;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.GenericGenerator;

//@Entity
@Entity
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class Attachment extends BaseEntity {

    @JsonSerialize(using = ToStringSerializer.class)
    @GeneratedValue(generator = "SnowIdGenerator")
    @GenericGenerator(type = com.hengyue.common.utils.SnowIdGenerator.class, name = "SnowIdGenerator")
    @Id
    private Long id;

    @Column(length = 50, unique = true)
    private String serialNo;

    @Column( length = 100)
    private String displayName;

    @Column(length = 10)
    private String fileExtension;

    @Column( length = 255)
    private String savePath;

    @Column
    private Integer storageType;

    @Column
    private Integer attachmentType;
}
